// 战斗中获取道具信息 {"id":76,"类型":"角色"}

// @ts-ignore
export async function execute(client_id, message_json) {
    let login_characters = G.Characters.get_current_login_characters(client_id);
    let fight_data = _FightDataCache.get(login_characters["战斗开关"]);
    if (login_characters["id"] === message_json["id"] && login_characters["战斗开关"] !== 0) {
        let fight_unit = G.FightUtils.get_fight_unit_by_characters(fight_data, login_characters);
        fight_unit["道具类型"] = "道具";
        ClientUtils.send_client_message(client_id, 5509, { "道具": login_characters["道具"] });
        return;
    }
    let characters = _CharactersData.get(message_json["id"]);

    if (fight_data === undefined) {
        return false;
    }
    // 校验是否参战并且为主玩家或助战
    if (characters && G.FightUtils.check_characters_is_fight_unit(characters)) {
        // 是否为同一账号下助战
        let ids = _UserNameCidsData.get(login_characters["账号"]);
        if (ids.includes(characters["id"])) {
            let fight_unit = G.FightUtils.get_fight_unit_by_characters(fight_data, login_characters);
            fight_unit["道具类型"] = "道具";
            ClientUtils.send_client_message(client_id, 5509, { "道具": characters["道具"] });
        }
    }
}
